<template>
  <view class="navbar" :style="{ paddingTop: safeAreaInsets?.top + 'px' }">
    <!-- 门店 -->
    <view class="logo">
      <navigator url="/pages/branch/branch" hover-class="none">
        <text class="logo-text" url="/pages/branch/branch">{{
          branchStore.branch.branchName
        }}</text>
      </navigator>
    </view>
    <!-- logo文字 -->
    <!-- <view class="logo">
      <text class="logo-text">百亿补贴 · 多快好省</text>
    </view> -->
    <!-- 搜索条 -->
    <view class="search">
      <text class="icon-search">搜索商品</text>
      <text class="icon-scan"></text>
    </view>
  </view>
</template>

<script setup lang="ts">
import { useBranchStore } from '@/stores'
import { onMounted, ref, defineExpose } from 'vue'
// 门店Store
const branchStore = useBranchStore()
// 获取屏幕安全区域
const { safeAreaInsets } = uni.getSystemInfoSync()
</script>

<style lang="scss">
.navbar {
  background-image: url(@/static/images/navigator_bg.jpg);
  background-size: cover;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  .logo {
    display: flex;
    align-items: center;
    height: 64rpx;
    padding-left: 30rpx;
    .logo-image {
      width: 166rpx;
      height: 39rpx;
    }
    .logo-text {
      flex: 1;
      line-height: 28rpx;
      color: #fff;
      font-size: 26rpx;
    }
  }
  .search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10rpx 0 26rpx;
    height: 64rpx;
    margin: 16rpx 20rpx;
    color: #fff;
    font-size: 28rpx;
    border-radius: 32rpx;
    background-color: rgba(255, 255, 255, 0.5);
  }
  .icon-search {
    &::before {
      margin-right: 10rpx;
    }
    .icon-scan {
      font-size: 30rpx;
      padding: 15rpx;
    }
  }
}
</style>
